package com.ruoyi.common.enums;

/**
 * 用户点赞状态
 * 
 * @author ruoyi
 */
public enum RoyaltyRecordEnum
{
    DIRECT("1", "直推"),
    INDIRECT("2", "间推"),
    EVERY("3", "单单"),
    PEER("4", "平级推"),
    OVERSTEP("5", "跨级推"),
    DIVIDENDS("6", "奖金分红");

    private final String code;
    private final String info;

    RoyaltyRecordEnum(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    // 静态方法，用于通过code查找对应的枚举实例
    public static RoyaltyRecordEnum findByCode(String code) {
        for (RoyaltyRecordEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }

    // 静态方法，用于通过code查找对应的信息
    public static String getTypeName(String code) {
        RoyaltyRecordEnum type = findByCode(code);
        return type != null ? type.getInfo() : "";
    }
}
